package com.cn.qtms.entity;//类注释设置模板

import com.cn.qtms.base.entity.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @Name:TmOrderDetail
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-11-21 17:22
 **/

@Entity
@Table(name = "tm_order_detail")
@org.hibernate.annotations.Table(appliesTo = "tm_order_detail",comment="订单详情表")
@Getter
@Setter
public class TmOrderDetail extends BaseEntity {

    @Column(name = "order_id", columnDefinition = "bigint(20) comment '订单id'")
    @ApiModelProperty(value = "用户id")
    private Long orderId;

    @Column(name="coupon_id", columnDefinition = "bigint(20) COMMENT '优惠券id'")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long couponId;

    @Column(name = "buy_count", columnDefinition = "int COMMENT '购买数量'")
    private Integer buyCount;

    @Column(name = "purchase_price", columnDefinition = "decimal(9,2) COMMENT '采购价'")
    private BigDecimal purchasePrice;


}
